Nandha Clg Friend
last seen today at 3:05 pm
27/1/2025
Forwarded
2:11 pm
3/3/2025
Forwarded
java PRACTICAL PROGRAMS.docx
DOCX•997 kB•
2:18 pm
import java.util.Scanner;
public class TextStatistics {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("Enter your text (type 'exit' to finish):");
int charCount = 0;
int wordCount = 0;
int lineCount = 0;
while (true) {
String line = scanner.nextLine();
if (line.equalsIgnoreCase("exit")) {
break;
}
lineCount++;
charCount += line.length();
String[] words = line.split("\\s+");
wordCount += words.length;
}
System.out.println("Number of characters: " + charCount);
System.out.println("Number of words: " + wordCount);
System.out.println("Number of lines: " + lineCount);
scanner.close();
}
}2:24 pm
2:24 pm
12/3/2025
2021 2024 d sec.pdf
129 pages•PDF•39 MB•
4:53 pm
Adobe Scan 12 Mar 2025.pdf
6 pages•PDF•2 MB•
4:54 pm
TODAY
11:32 am
11:32 am
11:32 am
Forwarded
Red and Black Simple Modern Designer Freelance Resume (3).pdf
1 page•PDF•149 kB•
3:18 pm
